package elementui.base;

/**
 * elementui.base zgw --2020/6/29 2:07 下午
 * author javazgw@gmail.com
 */
public class Button {

    /**
     *
     * 参数	说明	类型	可选值	默认值
     * size	尺寸	string	medium / small / mini	—
     * type	类型	string	primary / success / warning / danger / info / text	—
     * plain	是否朴素按钮	boolean	—	false
     * round	是否圆角按钮	boolean	—	false
     * circle	是否圆形按钮	boolean	—	false
     * loading	是否加载中状态	boolean	—	false
     * disabled	是否禁用状态	boolean	—	false
     * icon	图标类名	string	—	—
     * autofocus	是否默认聚焦	boolean	—	false
     * native-type	原生 type 属性	string	button / submit / reset	button
     */
    String size = "medium";
    String type = "primary";
    boolean plain = false;
    boolean round = false;
    boolean circle = false;
    boolean loading = false;
    boolean disabled = false;
    String icon ;
    boolean autofocus = false;

    public Button()
    {

    }
    public String getHtml(){
        return "<el-button type=\""+getType()+"\" "
                +(isPlain()?" plain ":" ")
                +(isRound()?" round ":" ")
                +(isCircle()?" circle ":" ")
                +(isDisabled()?" disabled ":" ")
                +(isLoading()?" :loading=\"true\" ":" ")
                +(isAutofocus()?" :loading=\"true\" ":" ")
                +(getIcon()==null?"":"icon=\" "+getIcon()+"\"")
                +">主要按钮</el-button>";

    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isPlain() {
        return plain;
    }

    public void setPlain(boolean plain) {
        this.plain = plain;
    }

    public boolean isRound() {
        return round;
    }

    public void setRound(boolean round) {
        this.round = round;
    }

    public boolean isCircle() {
        return circle;
    }

    public void setCircle(boolean circle) {
        this.circle = circle;
    }

    public boolean isLoading() {
        return loading;
    }

    public void setLoading(boolean loading) {
        this.loading = loading;
    }

    public boolean isDisabled() {
        return disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public boolean isAutofocus() {
        return autofocus;
    }

    public void setAutofocus(boolean autofocus) {
        this.autofocus = autofocus;
    }
}
